!function(){"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((function(e){n[e]=t[e]}));var r="Datadog Browser SDK:",o={debug:n.debug.bind(t,r),log:n.log.bind(t,r),info:n.info.bind(t,r),warn:n.warn.bind(t,r),error:n.error.bind(t,r)},i="https://docs.datadoghq.com",a="".concat(i,"/real_user_monitoring/browser/troubleshooting"),s="More details:";function c(e,t){return function(){for(var n=[],r=0;r"}finally{r(),o(),i(),a()}}function M(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):I}function D(e,t){return Object.keys(e).some((function(n){return e[n]===t}))}function N(e){return 0===Object.keys(e).length}function B(e){void 0===e&&(e=2);var t=new Map,n=!1;function r(r){if(void 0===r&&(r=0),!n&&0!==e){var i=2===e?3072:16384,c=r;t.forEach((function(e){c+=e.getBytesCount()})),c>i&&(!function(e){o.warn("Customer data exceeds the recommended ".concat(e/C,"KiB threshold. ").concat(s," ").concat(a,"/#customer-data-exceeds-the-recommended-threshold-warning"))}(i),n=!0)}}return{createDetachedTracker:function(){var e=U((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,U(r)),t.get(e)},setCompressionStatus:function(t){0===e&&(e=t,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach((function(e){return e.stop()})),t.clear()}}}function U(e){var t=0,n=A((function(n){t=_(P(n)),e()}),200),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(e){N(e)?i():r(e)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function q(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function j(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;it)){for(;o.length>0&&ct){J(t,"truncated",e);break}u.target[l]=d}else for(var l in u.source)if(Object.prototype.hasOwnProperty.call(u.source,l)){var d;if(void 0!==(d=z(u.source[l],u.path,l,o,i))&&(c+=JSON.stringify(d).length+f+l.length+3,f=1),c>t){J(t,"truncated",e);break}u.target[l]=d}}return n(),r(),a}J(t,"discarded",e)}function z(e,t,n,r,o){var i=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!i||"object"!=typeof i)return function(e){if("bigint"==typeof e)return"[BigInt] ".concat(e.toString());if("function"==typeof e)return"[Function] ".concat(e.name||"unknown");if("symbol"==typeof e)return"[Symbol] ".concat(e.description||e.toString());return e}(i);var a=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"[".concat(t[1],"]")}catch(e){}return"[Unserializable]"}(i);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;var s=e;if(o.has(s))return"[Reference seen at ".concat(o.get(s),"]");var c=void 0!==n?"".concat(t,".").concat(n):t,u=Array.isArray(i)?[]:{};return o.set(s,c),r.push({source:i,target:u,path:c}),u}function J(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var W=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function V(){for(var e=[],t=0;t eval")>-1,r=fe.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||te,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=te),t.push(n))})),{message:le(e,"message"),name:le(e,"name"),stack:t}}var re="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet||\\w+\\.|\\/).*?)",oe="(?::(\\d+))",ie=new RegExp("^\\s*at (.*?) ?\\(".concat(re).concat(oe,"?").concat(oe,"?\\)?\\s*$"),"i"),ae=new RegExp("\\((\\S*)".concat(oe).concat(oe,"\\)"));var se=new RegExp("^\\s*at ?".concat(re).concat(oe,"?").concat(oe,"??\\s*$"),"i");var ce=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var ue=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,fe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function le(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function de(e,t,n,r){var o=[{url:t,column:r,line:n}],i=function(e){var t,n,r;"[object String]"==={}.toString.call(e)&&(n=(t=ve.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var ve=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function pe(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return g((function(){var n=ne(t);n.stack=n.stack.slice(2),e=ge(n)})),e}function ge(e){var t=me(e);return e.stack.forEach((function(e){var n="?"===e.func?"":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function me(e){return"".concat(e.name||"Error",": ").concat(e.message)}var ye,he="No stack, consider using an instance of Error";function be(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,a=e.source,s=e.handling,c=Se(n),u=function(e,t,n,r){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":"".concat(n," ").concat(P(H(r)))}(t,c,i,n),f=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(c,t)?ge(t):he,l=c?ke(n,a):void 0;return{startClocks:o,source:a,handling:s,handlingStack:r,originalError:n,type:t?t.name:void 0,message:u,stack:f,causes:l,fingerprint:we(n)}}function we(e){return Se(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Se(e){return e instanceof Error||"[object Error]"===Object.prototype.toString.call(e)}function ke(e,t){for(var n=e,r=[];Se(null==n?void 0:n.cause)&&r.length<10;){var o=ne(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&ge(o)}),n=n.cause}return r.length?r:void 0}!function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.REMOTE_CONFIGURATION="remote_configuration",e.LONG_ANIMATION_FRAME="long_animation_frame",e.ANONYMOUS_USER_TRACKING="anonymous_user_tracking",e.ACTION_NAME_MASKING="action_name_masking",e.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",e.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(ye||(ye={}));var Ce=new Set;function xe(e){Array.isArray(e)&&e.filter((function(e){return D(ye,e)})).forEach((function(e){Ce.add(e)}))}function _e(e){return Ce.has(e)}function Ee(){return Ce}var Te,Oe="dd0g-gov.com",Re="datadoghq.com",Le="pci.browser-intake-datadoghq.com",Ae=["ddsource","ddtags"],Ie=1e3,Pe=6e4,Me=31536e6;function De(){return(new Date).getTime()}function Ne(){return De()}function Be(){return performance.now()}function Ue(){return{relative:Be(),timeStamp:Ne()}}function qe(e,t){return e+t}function je(e){return e-Fe()}function Fe(){return void 0===Te&&(Te=performance.timing.navigationStart),Te}function Ge(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function He(e){return 0!==e&&100*Math.random()<=e}function ze(){var e,t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:null===(e=t.connection)||void 0===e?void 0:e.effectiveType}}function Je(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function We(){var e=[];return{add:function(t){e.push(t)>500&&e.splice(0,1)},remove:function(t){Je(e,t)},drain:function(t){e.forEach((function(e){return e(t)})),e.length=0}}}var Ve="log",$e="configuration",Ke="usage",Ye=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost",""],Xe=["ddog-gov.com"],Ze=We(),Qe=function(e){Ze.add((function(){return Qe(e)}))};function et(e,t){var n,r,o=new W,i=new Set,a=!y(Xe,t.site)&&He(t.telemetrySampleRate),s=((n={})[Ve]=a,n[$e]=a&&He(t.telemetryConfigurationSampleRate),n[Ke]=a&&He(t.telemetryUsageSampleRate),n),c={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Qe=function(n){var a=P(n);if(s[n.type]&&i.size=gt[n.getLevel()]&&y(o,t)}var pt={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},gt=((at={})[pt.ok]=0,at[pt.debug]=1,at[pt.info]=2,at[pt.notice]=4,at[pt.warn]=5,at[pt.error]=6,at[pt.critical]=7,at[pt.alert]=8,at[pt.emerg]=9,at);function mt(e,t){var n=(void 0===t?{}:t).includeMessage,r=void 0!==n&&n;return{stack:e.stack,kind:e.type,message:r?e.message:void 0,causes:e.causes,fingerprint:e.fingerprint,handling:e.handling}}var yt=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ht="console",bt="http",wt=Object.keys(pt),St=function(){function e(e,t,n,r,o,i){void 0===r&&(r=bt),void 0===o&&(o=pt.debug),void 0===i&&(i={}),this.handleLogStrategy=e,this.handlerType=r,this.level=o,this.contextManager=$(t),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.logImplementation=function(e,t,n,r,o){void 0===n&&(n=pt.info);var i,a=H(t);null!=r?i=G({error:mt(be({stackTrace:Se(r)?ne(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:ut,handling:"handled",startClocks:Ue()}),{includeMessage:!0})},a):i=a;this.handleLogStrategy({message:H(e),context:i,status:n},this,o)},e.prototype.log=function(e,t,n,r){var o;void 0===n&&(n=pt.info),vt(n,bt,this)&&(o=pe()),this.logImplementation(e,t,n,r,o)},e.prototype.setContext=function(e){this.contextManager.setContext(e)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(e,t){this.contextManager.setContextProperty(e,t)},e.prototype.removeContextProperty=function(e){this.contextManager.removeContextProperty(e)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},yt([v],e.prototype,"logImplementation",null),e}();function kt(e){return function(t,n,r){var o;vt(e,bt,this)&&(o=pe()),this.logImplementation(t,n,e,r,o)}}function Ct(){var e=k().DatadogEventBridge;if(e)return{getCapabilities:function(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel:function(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n,r){var o=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:o}))}}}function xt(e){var t;void 0===e&&(e=null===(t=k().location)||void 0===t?void 0:t.hostname);var n=Ct();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function _t(e,t,n,r){var o=(void 0===r?{}:r).computeHandlingStack,i=e[t];if("function"!=typeof i){if(!(t in e)||!w(t,"on"))return{stop:I};i=I}var a=!1,s=function(){if(a)return i.apply(this,arguments);var e,t=h(arguments);g(n,null,[{target:this,parameters:t,onPostCall:function(t){e=t},handlingStack:o?pe():void 0}]);var r=i.apply(this,t);return e&&g(e,null,[r]),r};return e[t]=s,{stop:function(){a=!0,e[t]===s&&(e[t]=i)}}}function Et(e){return Tt(e,location.href).href}function Tt(e,t){var n=function(){if(void 0===Ot)try{var e=new Lt("http://test/path");Ot="http://test/path"===e.href}catch(e){Ot=!1}return Ot?Lt:void 0}();if(n)try{return void 0!==t?new n(e,t):new n(e)}catch(n){throw new Error("Failed to construct URL: ".concat(String(n)," ").concat(P({url:e,base:t})))}if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var r=document,o=r.createElement("a");if(void 0!==t){var i=(r=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(o)}return o.href=e,o}St.prototype.ok=kt(pt.ok),St.prototype.debug=kt(pt.debug),St.prototype.info=kt(pt.info),St.prototype.notice=kt(pt.notice),St.prototype.warn=kt(pt.warn),St.prototype.error=kt(pt.error),St.prototype.critical=kt(pt.critical),St.prototype.alert=kt(pt.alert),St.prototype.emerg=kt(pt.emerg);var Ot,Rt,Lt=URL;function At(){return Rt||(Rt=new W((function(e){if(window.fetch){var t=_t(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=e.handlingStack,i=n[0],a=n[1],s=a&&a.method;void 0===s&&i instanceof Request&&(s=i.method);var c=void 0!==s?String(s).toUpperCase():"GET",u=i instanceof Request?i.url:Et(String(i)),f=Ue(),l={state:"start",init:a,input:i,method:c,startClocks:f,url:u,handlingStack:o};t.notify(l),n[0]=l.input,n[1]=l.init,r((function(e){return function(e,t,n){var r=n;function o(t){r.state="resolve",S(r,t),e.notify(r)}t.then(p((function(e){o({response:e,responseType:e.type,status:e.status,isAborted:!1})})),p((function(e){var t,n;o({status:0,isAborted:(null===(n=null===(t=r.init)||void 0===t?void 0:t.signal)||void 0===n?void 0:n.aborted)||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,error:e})})))}(t,e,l)}))}(t,e)}),{computeHandlingStack:!0}).stop;return t}}))),Rt}function It(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,It)}var Pt,Mt,Dt,Nt=/([\w-]+)\s*=\s*([^;]+)/g;function Bt(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}function Ut(){return null!=Pt?Pt:Pt=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return 1;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 2;if(e.document.documentMode)return 0;return 3}()}function qt(e,t,n,r){void 0===n&&(n=0);var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain=".concat(r.domain):"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(s).concat(c).concat(u)}function jt(e){return function(e,t){for(Nt.lastIndex=0;;){var n=Nt.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function Ft(e){return Mt||(Mt=function(e){var t=new Map;for(Nt.lastIndex=0;;){var n=Nt.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),Mt.get(e)}function Gt(e,t){qt(e,"",0,t)}var Ht="_dd_s",zt=144e5,Jt=9e5,Wt=Me,Vt="cookie",$t="local-storage",Kt=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Yt(e){var t={isExpired:"1"};return _e(ye.ANONYMOUS_USER_TRACKING)&&((null==e?void 0:e.anonymousId)?t.anonymousId=null==e?void 0:e.anonymousId:t.anonymousId=Math.floor(Math.random()*Math.pow(2,53)).toString(36)),t}function Xt(e){return N(e)}function Zt(e){return!Xt(e)}function Qt(e){return void 0!==e.isExpired||!((void 0===(t=e).created||De()-Number(t.created)=100)gn(t);else{var u,f=c();if(o){if(f.lock)return void pn(e,t,n);if(u=It(),s(f.session),(f=c()).lock!==u)return void pn(e,t,n)}var l=e.process(f.session);if(o&&(f=c()).lock!==u)pn(e,t,n);else{if(l&&(Qt(l)?a(l):(en(l),o?s(l):i(l))),o&&(!l||!Qt(l))){if((f=c()).lock!==u)return void pn(e,t,n);i(f.session),l=f.session}null===(r=e.after)||void 0===r||r.call(e,l||f.session),gn(t)}}else dn.push(e)}function pn(e,t,n){T((function(){vn(e,t,n+1)}),10)}function gn(e){ln=void 0;var t=dn.shift();t&&vn(t,e)}var mn=Ie;function yn(e){switch(e.sessionPersistence){case Vt:return rn(e);case $t:return sn();case void 0:var t=rn(e);return!t&&e.allowFallbackToLocalStorage&&(t=sn()),t;default:o.error("Invalid session persistence '".concat(String(e.sessionPersistence),"'"))}}function hn(e,t,n){var r,o=new W,i=new W,a=new W,s=e.type===Vt?on(e.cookieOptions):{isLockEnabled:!1,persistSession:cn,retrieveSession:un,expireSession:fn},c=s.expireSession,u=R((function(){vn({process:function(e){return Qt(e)?Yt(e):void 0},after:v},s)}),mn);p();var f=A((function(){vn({process:function(e){if(!Xt(e)){var r=v(e);return function(e){if(Xt(e))return!1;var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,delete e.isExpired,i&&!e.id&&(e.id=It(),e.created=String(De()))}(r),r}},after:function(e){Zt(e)&&!g()&&function(e){r=e,o.notify()}(e),r=e}},s)}),mn),l=f.throttled,d=f.cancel;function v(e){return Qt(e)&&(e=Yt(e)),g()&&(!function(e){return r.id!==e.id||r[t]!==e[t]}(e)?(a.notify({previousState:r,newState:e}),r=e):(r=Yt(r),i.notify())),e}function p(){vn({process:function(e){if(Xt(e))return Yt(e)},after:function(e){r=e}},s)}function g(){return void 0!==r[t]}return{expandOrRenewSession:l,expandSession:function(){vn({process:function(e){return g()?v(e):void 0}},s)},getSession:function(){return r},renewObservable:o,expireObservable:i,sessionStateUpdateObservable:a,restartSession:p,expire:function(){d(),c(r),v(Yt(r))},stop:function(){L(u)},updateSessionState:function(e){vn({process:function(t){return S({},t,e)},after:v},s)}}}function bn(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=Et(r);return function(e){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(n,"?").concat(e)))}}if("function"==typeof r)return function(e){return r({path:n,parameters:e})};var i=function(e,t){var n=t.site,r=void 0===n?Re:n,o=t.internalAnalyticsSubdomain;if("logs"===e&&t.usePciIntake&&r===Re)return Le;if(o&&r===Re)return"".concat(o,".").concat(Re);if(r===Oe)return"http-intake.logs.".concat(r);var i=r.split("."),a=i.pop();return"browser-intake-".concat(i.join("-"),".").concat(a)}(t,e);return function(e){return"https://".concat(i).concat(n,"?").concat(e)}}(e,t);return{build:function(o,i){var a=function(e,t,n,r,o){var i=e.clientToken,a=e.internalAnalyticsSubdomain,s=o.retry,c=o.encoding,u=["sdk_version:".concat("5.35.1"),"api:".concat(r)].concat(n);s&&u.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var f=["ddsource=browser","ddtags=".concat(encodeURIComponent(u.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.35.1")),"dd-evp-origin=browser","dd-request-id=".concat(It())];c&&f.push("dd-evp-encoding=".concat(c));"rum"===t&&f.push("batch_time=".concat(Ne()));a&&f.reverse();return f.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}function wn(e,t){var n=200-e.length-1;(t.length>n||function(e){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(e){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e)}(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized. ").concat(s," ").concat(i,"/getting_started/tagging/#defining-tags"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function Sn(e){var t=e.site||Re,n=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(wn("env",t)),n&&i.push(wn("service",n)),r&&i.push(wn("version",r)),o&&i.push(wn("datacenter",o)),i}(e),r=function(e,t){return{logsEndpointBuilder:bn(e,"logs",t),rumEndpointBuilder:bn(e,"rum",t),sessionReplayEndpointBuilder:bn(e,"replay",t)}}(e,n),o=function(e,t){if(!e.replica)return;var n=S({},e,{site:Re,clientToken:e.replica.clientToken}),r={logsEndpointBuilder:bn(n,"logs",t),rumEndpointBuilder:bn(n,"rum",t)};return S({applicationId:e.replica.applicationId},r)}(e,n);return S({replica:o,site:t},r)}function kn(e,t){return null==e||"string"==typeof e||(o.error("".concat(t," must be defined as a string")),!1)}function Cn(e,t){return!!(void 0===e||(n=e,function(e){return"number"==typeof e}(n)&&n>=0&&n<=100))||(o.error("".concat(t," Sample Rate should be a number between 0 and 100")),!1);var n}function xn(e){var t,n,r,a,u;if(e&&e.clientToken){if((!(f=e.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(o.error("Site should be a valid Datadog site. ".concat(s," ").concat(i,"/getting_started/site/.")),0))&&Cn(e.sessionSampleRate,"Session")&&Cn(e.telemetrySampleRate,"Telemetry")&&Cn(e.telemetryConfigurationSampleRate,"Telemetry Configuration")&&Cn(e.telemetryUsageSampleRate,"Telemetry Usage")&&kn(e.version,"Version")&&kn(e.env,"Env")&&kn(e.service,"Service")){var f;if(void 0===e.trackingConsent||D(K,e.trackingConsent))return S({beforeSend:e.beforeSend&&c(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:yn(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(a=e.telemetryUsageSampleRate)&&void 0!==a?a:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(u=e.trackingConsent)&&void 0!==u?u:K.GRANTED,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144},Sn(e));o.error('Tracking Consent should be either "granted" or "not-granted"')}}else o.error("Client Token is not configured, we will not send any data.")}var _n={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function En(e,t){var n=[];y(t,_n.cspViolation)&&n.push(function(e){return new W((function(t){return Y(e,document,"securitypolicyviolation",(function(e){t.notify(function(e){var t="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return Tn({type:e.effectiveDirective,message:"".concat(_n.cspViolation,": ").concat(t),originalError:e,csp:{disposition:e.disposition},stack:On(e.effectiveDirective,e.originalPolicy?"".concat(t,' of the policy "').concat(Bt(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==_n.cspViolation}));return r.length&&n.push(function(e){return new W((function(t){if(window.ReportingObserver){var n=p((function(e,n){return e.forEach((function(e){return t.notify(function(e){var t=e.type,n=e.body;return Tn({type:n.id,message:"".concat(t,": ").concat(n.message),originalError:e,stack:On(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}))}(r)),V.apply(void 0,n)}function Tn(e){return S({startClocks:Ue(),source:dt,handling:"unhandled"},e)}function On(e,t,n,r,o){return n?ge({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}function Rn(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return y(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),h(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}function Ln(t,n,r){var i,a,s=We(),c=n.observable.subscribe(u);function u(){if(a&&i&&n.isGranted()){c.unsubscribe();var e=r(i,a);s.drain(e)}}return{init:function(t){if(t)if(xe(t.enableExperimentalFeatures),xt()&&(t=function(e){return S({},e,{clientToken:"empty"})}(t)),i=t,a)it("DD_LOGS",t);else{var r=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&o.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var n=xn(t),r=Rn(t.forwardConsoleLogs,b(e),"Forward Console Logs"),i=Rn(t.forwardReports,b(_n),"Forward Reports");if(n&&r&&i)return t.forwardErrorsToLogs&&!y(r,e.error)&&r.push(e.error),S({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:32768,sendLogsAfterSessionExpiration:!!t.sendLogsAfterSessionExpiration},n)}(t);r&&(a=r,At().subscribe(I),n.tryToInit(r.trackingConsent),u())}else o.error("Missing configuration")},get initConfiguration(){return i},getInternalContext:I,handleLog:function(e,n,r,o,i){void 0===o&&(o=t()),void 0===i&&(i=Ne()),s.add((function(t){return t.handleLog(e,n,r,o,i)}))}}}var An="logs";var In={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Pn(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Ft("datadog-synthetics-injects-rum"))}function Mn(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Ft("datadog-synthetics-result-id");return"string"==typeof e?e:void 0}var Dn=1/0;function Nn(e){var t=e.expireDelay,n=e.maxEntries,r=[],o=R((function(){return function(){var e=Be()-t;for(;r.length>0&&r[r.length-1].endTime=n&&r.pop(),r.unshift(o),o},find:function(e,t){void 0===e&&(e=Dn),void 0===t&&(t={returnInactive:!1});for(var n=0,o=r;n=500}function nr(e,t){if(!e.forwardErrorsToLogs)return{stop:I};var n=Zn(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=At().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){var o;function i(e){var o={isAborted:r.isAborted,handlingStack:r.handlingStack};t.notify(0,{rawLogsEvent:{message:"".concat(or(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{stack:e||"Failed to load",handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:pt.error,origin:ft},domainContext:o})}o=r.url,Ae.every((function(e){return y(o,e)}))||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!tr(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(rr(e.response,t)):n(e.response)}(r.xhr,e,i):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function a(){var e,a;if(r.cancel().catch(I),n.collectStreamBody){var s;if(1===o.length)s=o[0];else{s=new Uint8Array(i);var c=0;o.forEach((function(e){s.set(e,c),c+=e.length}))}e=s.slice(0,n.bytesLimit),a=s.length>n.bytesLimit}t(void 0,e,a)}!function e(){r.read().then(p((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),p((function(e){return t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):r.text().then(p((function(e){return n(rr(e,t))})),p((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,i):r.error&&function(e,t,n){n(rr(ge(ne(e)),t))}(r.error,e,i))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function rr(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function or(e){return"xhr"===e?"XHR":"Fetch"}function ir(e){var t,n=function(t,n){var r=be({stackTrace:t,originalError:n,startClocks:Ue(),nonErrorPrefix:"Uncaught",source:lt,handling:"unhandled"});e.notify(r)},r=(t=n,_t(window,"onerror",(function(e){var n,r=e.parameters,o=r[0],i=r[1],a=r[2],s=r[3],c=r[4];n=Se(c)?ne(c):de(o,i,a,s),t(n,null!=c?c:o)}))).stop,o=function(e){return _t(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=ne(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var ar,sr=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}();function cr(e){return{handleLog:function(r,o,i,a,s){var c=G(o.getContext(),r.context);if(vt(r.status,ht,o)&&function(e,r){var o=e.status,i=e.message;n[ur[o]].call(t,i,r)}(r,c),vt(r.status,bt,o)){var u={rawLogsEvent:{date:s||Ne(),message:r.message,status:r.status,origin:ut},messageContext:c,savedCommonContext:a};i&&(u.domainContext={handlingStack:i}),e.notify(0,u)}}}}var ur=((ar={})[pt.ok]=e.debug,ar[pt.debug]=e.debug,ar[pt.info]=e.info,ar[pt.notice]=e.info,ar[pt.warn]=e.warn,ar[pt.error]=e.error,ar[pt.critical]=e.error,ar[pt.alert]=e.error,ar[pt.emerg]=e.error,ar);function fr(e){var t=e.encoder,n=e.request,r=e.flushController,i=e.messageBytesLimit,c={},u=r.flushObservable.subscribe((function(e){return function(e){var r=b(c).join("\n");c={};var o=(a=e.reason,y(b(In),a)),i=o?n.sendOnExit:n.send;var a;if(o&&t.isAsync){var s=t.finishSync();s.outputBytesCount&&i(lr(s));var u=[s.pendingData,r].filter(Boolean).join("\n");u&&i({data:u,bytesCount:_(u)})}else r&&t.write(t.isEmpty?r:"\n".concat(r)),t.finish((function(e){i(lr(e))}))}(e)}));function f(e,n){var u=P(e),f=t.estimateEncodedBytesCount(u);f>=i?o.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(i,"KB. ").concat(s," ").concat(a,"/#technical-limitations")):(function(e){return void 0!==e&&void 0!==c[e]}(n)&&function(e){var n=c[e];delete c[e];var o=t.estimateEncodedBytesCount(n);r.notifyAfterRemoveMessage(o)}(n),function(e,n,o){r.notifyBeforeAddMessage(n),void 0!==o?(c[o]=e,r.notifyAfterAddMessage()):t.write(t.isEmpty?e:"\n".concat(e),(function(e){r.notifyAfterAddMessage(e-n)}))}(u,f,n))}return{flushController:r,add:f,upsert:f,stop:u.unsubscribe}}function lr(e){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding}}var dr=3145728,vr=Ie;function pr(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?mr(e,t,n,{onSuccess:function(){return yr(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),gr(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function gr(e,t,n,r){2===e.transportStatus&&T((function(){mr(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=vr,yr(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(6e4,2*e.currentBackoffTime),gr(e,t,n,r)}})}),e.currentBackoffTime)}function mr(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||tr(e.status))}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},i())}))}function yr(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(3,"MiB"),source:st,startClocks:Ue()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=hr();i.size()>0;)pr(i.dequeue(),t,n,r,o)}function hr(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=dr}}}function br(e,t,n){var r={transportStatus:0,currentBackoffTime:vr,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=81920&&this.ongoingRequestCount<32},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:hr(),queueFullReported:!1},o=function(n,r){return function(e,t,n,r){var o=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&n.bytesCount=r&&d("bytes_limit"),l+=1,f+=e,void 0===t&&(t=T((function(){d("duration_limit")}),o))},notifyAfterAddMessage:function(e){void 0===e&&(e=0),f+=e,l>=n?d("messages_limit"):f>=r&&d("bytes_limit")},notifyAfterRemoveMessage:function(e){f-=e,0===(l-=1)&&v()}}}function Cr(e,t,n,r,o,i,a){void 0===a&&(a=fr);var s=u(e,t),c=n&&u(e,n);function u(e,t){var n=t.endpoint,s=t.encoder;return a({encoder:s,request:br(n,e.batchBytesLimit,r),flushController:kr({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),messageBytesLimit:e.messageBytesLimit})}return{flushObservable:s.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),s.add(e),c&&t&&c.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){s.upsert(e,t),c&&c.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){s.stop(),c&&c.stop()}}}function xr(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=_(n);t+=o,e+=n,r&&r(o)},finish:function(e){e(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(e){return e.length}}}function _r(e,t,n,r,o){var i=et("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,a;return{application:{id:null===(e=zn())||void 0===e?void 0:e.application_id},session:{id:null===(t=o.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=zn())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(a=null===(i=zn())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));var a=[];if(xt()){var s=Ct(),c=i.observable.subscribe((function(e){return s.send("internal_telemetry",e)}));a.push((function(){return c.unsubscribe()}))}else{var u=Cr(t,{endpoint:t.rumEndpointBuilder,encoder:xr()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:xr()},n,r,o.expireObservable);a.push((function(){return u.stop()}));var f=i.observable.subscribe((function(e){return u.add(e,function(e){return"datad0g.com"===e.site}(t))}));a.push((function(){return f.unsubscribe()}))}return Ze.drain(),function(e){Qe({type:$e,configuration:e})}(function(e){var t,n={session_sample_rate:(t=e).sessionSampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:t.telemetryUsageSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:t.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:!!t.proxy,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,session_persistence:t.sessionPersistence,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages,allow_untrusted_events:!!t.allowUntrustedEvents,tracking_consent:t.trackingConsent};return S({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,send_logs_after_session_expiration:e.sendLogsAfterSessionExpiration},n)}(e)),{telemetry:i,stop:function(){a.forEach((function(e){return e()}))}}}var Er,Tr,Or,Rr,Lr=function(e){var t,n,r=B(),i=$(r.getOrCreateTracker(2)),a=$(r.getOrCreateTracker(1)),s={tryToInit:function(e){t||(t=e)},update:function(e){t=e,n.notify()},isGranted:function(){return t===K.GRANTED},observable:n=new W};function c(){return function(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}(i,a)}var u,f,l=Ln(c,s,(function(t,n){t.storeContextsAcrossPages&&(ee(n,i,An,2),ee(n,a,An,1));var r=e(t,n,c,s);return l=function(e,t){return S({init:function(e){it("DD_LOGS",e)},initConfiguration:e},t)}(t,r),r})),v={},g=new St((function(){for(var e=[],t=0;t